Here are the instructions for replacing the existing game sound effect with a new one.

The sound effect replaced here is the explosion sound played when the player crashes the miner.\hypertarget{replacing_sound_effect_createSoundEffectFile}{}\section{Creating a Sound Effect File}\label{replacing_sound_effect_createSoundEffectFile}
First you must have a WAV file with a correct audio format and volume level. The correct audio format of the sound effects is a 16-\/bit PCM stereo with 8 kHZ sampling rate. Sound effects can be converted using a \href{http://sox.sourceforge.net/}{\tt SOX} tool: 
\begin{DoxyCode}
    $ sox explosion_orig.wav new_explosion.wav channels 2 rate 8k
\end{DoxyCode}
 The volume level must be normalized so that every sound effect has the same output volume. \href{http://normalize.nongnu.org/}{\tt Normalize} audio tool can be used for this: 
\begin{DoxyCode}
    $ normalize-audio -bv *.wav
\end{DoxyCode}
\hypertarget{replacing_sound_effect_addSoundEffectFileToResources}{}\section{Adding the Sound Effect File to Resources}\label{replacing_sound_effect_addSoundEffectFileToResources}
Next thing to do is to add the sound effect file to the resources so that it can be used at the game. The sound files are stored under the project folder to the {\ttfamily }./sounds folder.

Copy the file {\ttfamily new\_\-explosion.wav} to {\ttfamily }./sounds folder. Then the resource file smashminer.qrc must be edited. Add {\ttfamily new\_\-explosion.wav} file to the resources under {\ttfamily sounds} resource prefix.

Then add alias {\ttfamily \char`\"{}explosion.wav\char`\"{}} for the resource file.

Now the resource file can be referenced from the source code.\hypertarget{replacing_sound_effect_referenceSoundEffectFileFromSourceCode}{}\section{Referencing the New Sound Effect File from Source Code}\label{replacing_sound_effect_referenceSoundEffectFileFromSourceCode}
The sound effect files in resources are used from the \hyperlink{class_sound_engine}{SoundEngine} constructor \hyperlink{class_sound_engine_a2253b41298fb1e82ed7b8afc7969e1d6}{SoundEngine::SoundEngine}. The loadFile() method is used to load the sound file from resources to the sound engine.

Finally replace the resource reference to the old \href{file:}{\tt file:} 
\begin{DoxyCode}
    ...
    loadFile(SoundExplosion, ":/sounds/explosion.wav");
    ...
\end{DoxyCode}
 With the reference to the new \href{file:}{\tt file:} 
\begin{DoxyCode}
    ...
    loadFile(SoundExplosion, ":/sounds/new_explosion.wav");
    ...
\end{DoxyCode}


The old sound effect is replaced with the new one. 